package casamento.util;

import javax.faces.component.UIComponent;
import javax.faces.component.UIInput;
import javax.faces.event.AbortProcessingException;
import javax.faces.event.ActionEvent;
import javax.faces.event.ActionListener;

public class ValidaSegmento implements ActionListener{
	
	@Override
	public void processAction(ActionEvent event) throws AbortProcessingException {
		
		UIComponent component = event.getComponent();
		UIInput  input = (UIInput) component.findComponent("nomeSegmento");
		
		if(input.getValue().equals("") || input.getValue() == null ){
			input.getAttributes().put("style", "background:#f2dede; border-color:#cd0a0a");
			
		}else{
			input.getAttributes().put("style","");
			
		}
	}
	
}
